home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 52
/
Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso
/
Aminet
/
dev
/
lang
/
amigatalk.lha
/
intuition
/
IconTags.st
< prev
next >
Wrap
Text File
|
2002-03-15
|
13KB
|
333 lines
" -------------------------------------------------------------------- "
" IconTypeTags Class allows the User to reference icon types used by "
" various Icon methods as Symbols. "
""
" The User does NOT need to create one of these, since Intuition Class "
" will instantiate the only needed instance of this Class. See the "
" SetupIntuition.st source file for the method(s) that help the User "
" with this Class. "
""
" EXAMPLE: 'myTag <- intuition getIcontTypeTag: #WBDISK' "
""
" ALL singleton classes MUST contain the following: "
""
" the methods: isSingleton AND privateSetup AND "
" uniqueInstance Class instance variable. "
" -------------------------------------------------------------------- "
Class IconTypeTags :Dictionary ! uniqueInstance !
[
isSingleton
^ true
|
privateNew ! newinstance !
newinstance <- super new.
^ newinstance
|
new
^ self privateSetup
|
privateInitializeDictionary
self at: #WBDISK put: 1.
self at: #WBDRAWER put: 2.
self at: #WBTOOL put: 3.
self at: #WBPROJECT put: 4.
self at: #WBGARBAGE put: 5.
self at: #WBDEVICE put: 6.
self at: #WBKICK put: 7.
self at: #WBAPPICON put: 8.
|
privateSetup
(uniqueInstance isNil)
ifTrue: [uniqueInstance <- self privateNew.
self privateInitializeDictionary
].
^ self "or ^ uniqueInstance??"
]
" -------------------------------------------------------------------- "
" IconTags Class allows the User to reference icon tags used by "
" various Icon methods as Symbols. "
""
" The User does NOT need to create one of these, since Intuition Class "
" will instantiate the only needed instance of this Class. See the "
" SetupIntuition.st source file for the method(s) that help the User "
" with this Class. "
""
" EXAMPLE: 'myTag <- intuition getIcontTag: #ICONCTRLA_SetWidth' "
""
" ALL singleton classes MUST contain the following: "
""
" the methods: isSingleton AND privateSetup AND "
" uniqueInstance Class instance variable. "
" -------------------------------------------------------------------- "
Class IconTags :Dictionary ! uniqueInstance !
[
isSingleton
^ true
|
privateNew ! newinstance !
newinstance <- super new.
^ newinstance
|
new
^ self privateSetup
|
privateInitializeDictionary
" Error reporting (Integer): "
self at: #ICONA_ErrorCode put: 16r80009001.
" Points to the tag item that caused the error (struct TagItem **). "
self at: #ICONA_ErrorTagItem put: 16r8000904B.
" Global options for IconControlA(): ----------------------------- "
" Screen to use for remapping Workbench icons to (ScreenObj): "
self at: #ICONCTRLA_SetGlobalScreen put: 16r80009002.
self at: #ICONCTRLA_GetGlobalScreen put: 16r80009003.
" Icon color remapping precision; defaults to PRECISION_ICON (Integer) "
self at: #ICONCTRLA_SetGlobalPrecision put: 16r80009004.
self at: #ICONCTRLA_GetGlobalPrecision put: 16r80009005.
" Icon frame size dimensions (RectangleObj): "
self at: #ICONCTRLA_SetGlobalEmbossRect put: 16r80009006.
self at: #ICONCTRLA_GetGlobalEmbossRect put: 16r80009007.
" Render image without frame (Boolean): "
self at: #ICONCTRLA_SetGlobalFrameless put: 16r80009008.
self at: #ICONCTRLA_GetGlobalFrameless put: 16r80009009.
" Enable NewIcons support (Boolean): "
self at: #ICONCTRLA_SetGlobalNewIconsSupport put: 16r8000900A.
self at: #ICONCTRLA_GetGlobalNewIconsSupport put: 16r8000900B.
" Enable color icon support (Boolean) "
self at: #ICONCTRLA_SetGlobalColorIconSupport put: 16r8000904D.
self at: #ICONCTRLA_GetGlobalColorIconSupport put: 16r8000904E.
" Set/Get the hook to be called when identifying a file (HookObj) "
self at: #ICONCTRLA_SetGlobalIdentifyHook put: 16r8000900C.
self at: #ICONCTRLA_GetGlobalIdentifyHook put: 16r8000900D.
" Set/get the maximum length of a file/drawer name supported
* by icon.library (Integer).
"
self at: #ICONCTRLA_SetGlobalMaxNameLength put: 16r80009043.
self at: #ICONCTRLA_GetGlobalMaxNameLength put: 16r80009044.
" Per icon local options for IconControlA(): --------------------- "
" Get the icon rendering masks (PLANEPTR) "
self at: #ICONCTRLA_GetImageMask1 put: 16r8000900E.
self at: #ICONCTRLA_GetImageMask2 put: 16r8000900F.
" Transparent image color; set to -1 if opaque "
self at: #ICONCTRLA_SetTransparentColor1 put: 16r80009010.
self at: #ICONCTRLA_GetTransparentColor1 put: 16r80009011.
self at: #ICONCTRLA_SetTransparentColor2 put: 16r80009012.
self at: #ICONCTRLA_GetTransparentColor2 put: 16r80009013.
" Image color palette (struct ColorRegister *) "
self at: #ICONCTRLA_SetPalette1 put: 16r80009014.
self at: #ICONCTRLA_GetPalette1 put: 16r80009015.
self at: #ICONCTRLA_SetPalette2 put: 16r80009016.
self at: #ICONCTRLA_GetPalette2 put: 16r80009017.
" Size of image color palette (Integer) "
self at: #ICONCTRLA_SetPaletteSize1 put: 16r80009018.
self at: #ICONCTRLA_GetPaletteSize1 put: 16r80009019.
self at: #ICONCTRLA_SetPaletteSize2 put: 16r8000901A.
self at: #ICONCTRLA_GetPaletteSize2 put: 16r8000901B.
" Image data; one by per pixel (String) "
self at: #ICONCTRLA_SetImageData1 put: 16r8000901C.
self at: #ICONCTRLA_GetImageData1 put: 16r8000901D.
self at: #ICONCTRLA_SetImageData2 put: 16r8000901E.
self at: #ICONCTRLA_GetImageData2 put: 16r8000901F.
" Render image without frame (Boolean) "
self at: #ICONCTRLA_SetFrameless put: 16r80009020.
self at: #ICONCTRLA_GetFrameless put: 16r80009021.
" Enable NewIcons support (Boolean) "
self at: #ICONCTRLA_SetNewIconsSupport put: 16r80009022.
self at: #ICONCTRLA_GetNewIconsSupport put: 16r80009023.
" Icon aspect ratio (String) "
self at: #ICONCTRLA_SetAspectRatio put: 16r80009024.
self at: #ICONCTRLA_GetAspectRatio put: 16r80009025.
" Icon dimensions; valid only for palette mapped icon images (LONG) "
self at: #ICONCTRLA_SetWidth put: 16r80009026.
self at: #ICONCTRLA_GetWidth put: 16r80009027.
self at: #ICONCTRLA_SetHeight put: 16r80009028.
self at: #ICONCTRLA_GetHeight put: 16r80009029.
" Check whether the icon is palette mapped (Integer). "
self at: #ICONCTRLA_IsPaletteMapped put: 16r8000902A.
" Get the screen the icon is attached to (ScreenObj). "
self at: #ICONCTRLA_GetScreen put: 16r8000902B.
" Check whether the icon has a real select image (Integer). "
self at: #ICONCTRLA_HasRealImage2 put: 16r8000902C.
" Check whether the icon is of the NewIcon type (iconObj). "
self at: #ICONCTRLA_IsNewIcon put: 16r8000904F.
" Check whether this icon was allocated by icon.library
* or if consists solely of a statically allocated
* struct DiskObject. (LONG *).
"
self at: #ICONCTRLA_IsNativeIcon put: 16r80009050.
" Icon aspect ratio is not known. "
self at: #ICON_ASPECT_RATIO_UNKNOWN put: 0.
" Tags for use with GetIconTagList(): ---------------------------- "
" Default icon type to retrieve (LONG) "
self at: #ICONGETA_GetDefaultType put: 16r8000902D.
" Retrieve default icon for the given name (String) "
self at: #ICONGETA_GetDefaultName put: 16r8000902E.
" Return a default icon if the req'd icon file cannot be found (Boolean).
"
self at: #ICONGETA_FailIfUnavailable put: 16r8000902F.
" If possible, retrieve a palette mapped icon (Boolean). "
self at: #ICONGETA_GetPaletteMappedIcon put: 16r80009030.
" Set if the icon returned is a default icon (BOOL *). "
self at: #ICONGETA_IsDefaultIcon put: 16r80009031.
" Remap the icon to the default screen, if possible (Boolean). "
self at: #ICONGETA_RemapIcon put: 16r80009032.
" Generate icon image masks (Boolean). "
self at: #ICONGETA_GenerateImageMasks put: 16r80009033.
" Label text to be assigned to the icon (String). "
self at: #ICONGETA_Label put: 16r80009034.
" Screen to remap the icon to (struct Screen *). "
self at: #ICONGETA_Screen put: 16r80009045.
" Tags for use with PutIconTagList(): ---------------------------- "
" Notify Workbench of the icon being written (Boolean) "
self at: #ICONPUTA_NotifyWorkbench put: 16r80009035.
" Store icon as the default for this type (LONG) "
self at: #ICONPUTA_PutDefaultType put: 16r80009036.
" Store icon as a default for the given name (String) "
self at: #ICONPUTA_PutDefaultName put: 16r80009037.
" When storing a palette mapped icon, don't save the
* the original planar icon image with the file. Replace
* it with a tiny replacement image.
"
self at: #ICONPUTA_DropPlanarIconImage put: 16r80009038.
" Don't write the chunky icon image data to disk. "
self at: #ICONPUTA_DropChunkyIconImage put: 16r80009039.
" Don't write the NewIcons tool types to disk. "
self at: #ICONPUTA_DropNewIconToolTypes put: 16r8000903A.
" If this tag is enabled, the writer will examine the icon image
* data to find out whether it can compress it more efficiently.
* This may take extra time and is not generally recommended.
"
self at: #ICONPUTA_OptimizeImageSpace put: 16r8000903B.
" Don't write the entire icon file back to disk, only change
* the do->do_CurrentX/do->do_CurrentY members.
"
self at: #ICONPUTA_OnlyUpdatePosition put: 16r80009048.
" Before writing a palette mapped icon back to disk,
* icon.library will make sure that the original
* planar image data is stored in the file. If you
* don't want that to happen, set this option to
* FALSE. This will allow you to change the planar icon
* image data written back to disk.
"
self at: #ICONPUTA_PreserveOldIconImages put: 16r80009054.
" Tags for use with DupDiskObjectA(): -------------------------- "
" Duplicate do_DrawerData "
self at: #ICONDUPA_DuplicateDrawerData put: 16r8000903C.
" Duplicate the Image structures. "
self at: #ICONDUPA_DuplicateImages put: 16r8000903D.
" Duplicate the image data (Image->ImageData) itself. "
self at: #ICONDUPA_DuplicateImageData put: 16r8000903E.
" Duplicate the default tool. "
self at: #ICONDUPA_DuplicateDefaultTool put: 16r8000903F.
" Duplicate the tool types list. "
self at: #ICONDUPA_DuplicateToolTypes put: 16r80009040.
" Duplicate the tool window. "
self at: #ICONDUPA_DuplicateToolWindow put: 16r80009041.
" If the icon to be duplicated is in fact a palette mapped
* icon which has never been set up to be displayed on the
* screen, turn the duplicate into that palette mapped icon.
"
self at: #ICONDUPA_ActivateImageData put: 16r80009052.
" Tags for use with DrawIconStateA() and GetIconRectangleA(). "
" Drawing information to use (struct DrawInfo *). "
self at: #ICONDRAWA_DrawInfo put: 16r80009042.
" Draw the icon without the surrounding frame (Boolean). "
self at: #ICONDRAWA_Frameless put: 16r80009046.
" Erase the background before drawing a frameless icon (Boolean). "
self at: #ICONDRAWA_EraseBackground put: 16r80009047.
" Draw the icon without the surrounding border and frame (Boolean). "
self at: #ICONDRAWA_Borderless put: 16r80009053.
" The icon to be drawn refers to a linked object (Boolean). "
self at: #ICONDRAWA_IsLink put: 16r80009059.
" Reserved tags; don't use: --------------------------------- "
self at: #ICONA_Reserved1 put: 16r80009049.
self at: #ICONA_Reserved2 put: 16r8000904A.
self at: #ICONA_Reserved3 put: 16r8000904C.
self at: #ICONA_Reserved4 put: 16r80009051.
self at: #ICONA_Reserved5 put: 16r80009055.
self at: #ICONA_Reserved6 put: 16r80009056.
self at: #ICONA_Reserved7 put: 16r80009057.
self at: #ICONA_Reserved8 put: 16r80009058.
self at: #ICONA_LAST_TAG put: 16r80009059.
|
privateSetup
(uniqueInstance isNil)
ifTrue: [uniqueInstance <- self privateNew.
self privateInitializeDictionary
].
^ self "or ^ uniqueInstance??"
]